﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace CMS.APP
{
    public class News
    {
        #region Fields
        /// <summary>
        /// 新闻Id
        /// </summary>
        private decimal id;
        /// <summary>
        /// 新闻Id
        /// </summary>
        public decimal Id
        {
            get { return id; }
            //set { id = value; }
        }
        /// <summary>
        /// 新闻标题
        /// </summary>
        private string title;
        /// <summary>
        /// 新闻标题
        /// </summary>
        public string Title
        {
            get { return title; }
            set { title = value; }
        }
        /// <summary>
        /// 新闻日期
        /// </summary>
        private DateTime? date;
        /// <summary>
        /// 新闻日期
        /// </summary>
        public DateTime? Date
        {
            get { return date; }
            set { date = value; }
        }
        /// <summary>
        /// 新闻初始栏目
        /// </summary>
        private string department;
        /// <summary>
        /// 新闻初始栏目
        /// </summary>
        public string Department
        {
            get { return department; }
            set { department = value; }
        }
        /// <summary>
        /// 新闻标签数量
        /// </summary>
        private int labelAmount;
        /// <summary>
        /// 新闻Tag数量
        /// </summary>
        private int tagAmount;
        /// <summary>
        /// 新闻投票数量
        /// </summary>
        private int voteAmount;
        /// <summary>
        /// 新闻页面数量
        /// </summary>
        private int pageAmount;
        /// <summary>
        /// 新闻发布数量
        /// </summary>
        private int publishAmount;

        /// <summary>
        /// 新闻Tag
        /// </summary>
        private ArrayList tag;
        /// <summary>
        /// 新闻Tag
        /// </summary>
        public ArrayList Tag
        {
            get { return tag; }
            set { tag = value; }
        }
        /// <summary>
        /// 新闻审核是否通过
        /// </summary>
        private int enablement;
        /// <summary>
        /// 新闻审核是否通过
        /// </summary>
        public int Enablement
        {
            get { return enablement; }
            //set { enablement = value; }
        }
        #endregion Fields

        #region OutFields
        private Pages pages;
        public Pages Pages
        {
            get { return pages; }
            //set { pages = value; }
        }
        private Labels labels;
        public Labels Labels
        {
            get { return labels; }
            //set { labels = value; }
        }
        private Votes votes;
        public Votes Votes
        {
            get { return votes; }
            //set { votes = value; }
        }
        private Publishes publishes;
        public Publishes Publishes
        {
            get { return publishes; }
            //set { publishes = value; }
        }
        #endregion OutFields

        #region List
        /// <summary>
        /// 新闻页面
        /// </summary>
        private List<Page> page;
        /// <summary>
        /// 新闻页面
        /// </summary>
        public List<Page> Page
        {
            get { return page; }
            //set { page = value; }
        }
        /// <summary>
        /// 新闻标签
        /// </summary>
        private List<Label> label;
        /// <summary>
        /// 新闻投票
        /// </summary>
        private List<Vote> vote;
        /// <summary>
        /// 新闻发布
        /// </summary>
        private List<Publish> publish;
        #endregion List

        #region Constructor
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="newsId">新闻Id</param>
        public News(decimal newsId)
        {
            //Get the news information from ORM

            //Setting--Pages
            CMS.APP.Pages newPages = new Pages(this.id, this.pageAmount);
            this.pages = newPages;
            //Setting--Labels
            CMS.APP.Labels newLabels = new Labels(this.id, this.labelAmount);
            this.labels = newLabels;
            //Setting--Votes
            CMS.APP.Votes newVotes = new Votes(this.id, this.voteAmount);
            this.votes = newVotes;
            //Setting--Publishes
            CMS.APP.Publishes newPublishes = new Publishes(this.id, this.publishAmount);
            this.publishes = newPublishes;
        }
        #endregion Constructor

        /// <summary>
        /// 更新
        /// </summary>
        public int Update()
        {
            throw new System.NotImplementedException();
        }
        /// <summary>
        /// 审核通过
        /// </summary>
        public int Enable()
        {
            return 0;
        }
        /// <summary>
        /// 审核不通过
        /// </summary>
        public int Disable()
        {
            return 0;
        }
    }
}
